package com.ruoyi.project.wenyanwen.generate.convert;


import com.ruoyi.project.dict.lishi.domain.CizuLishi;
import com.ruoyi.project.wenyanwen.generate.domain.sqlite.CizuLishiSqlite;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * @author jackyshi
 */
@Component
public class CizuLishiConvert extends AbstractConvert {

    protected static Log logger = LogFactory.getLog(CizuLishiConvert.class);

    @Override
    public List<CizuLishiSqlite> convert(List<?> list) {

        List<CizuLishiSqlite> l = new ArrayList<>();

        for (Object obj : list) {
            CizuLishi cizuLishi = (CizuLishi) obj;
            CizuLishiSqlite model = new CizuLishiSqlite();
            model.set_id(cizuLishi.getId().intValue());
            model.setCi(cizuLishi.getCi());
            model.setType(cizuLishi.getType());
            model.setZhujie(zipAndencrypt(cizuLishi.getJieshi()));
            l.add(model);
        }

        return l;
    }
}
